-
Notifications
You must be signed in to change notification settings - Fork 220
feat: strong equality matcher #1733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -61,6 +66,9 @@ public static <R extends HasMetadata> Result<R> match(R desired, R actualResourc | |||
var desiredSpecNode = objectMapper.valueToTree(ReconcilerUtils.getSpec(desired)); | |||
var actualSpecNode = objectMapper.valueToTree(ReconcilerUtils.getSpec(actualResource)); | |||
var diffJsonPatch = JsonDiff.asJson(desiredSpecNode, actualSpecNode); | |||
if (strongEquality && diffJsonPatch.size() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment as to why this determines that things are not equal according to "strong equality" would be helpful. For that matter, defining what strong equality is would be helpful! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to equality, added detailed javadoc
@@ -61,6 +90,9 @@ public static <R extends HasMetadata> Result<R> match(R desired, R actualResourc | |||
var desiredSpecNode = objectMapper.valueToTree(ReconcilerUtils.getSpec(desired)); | |||
var actualSpecNode = objectMapper.valueToTree(ReconcilerUtils.getSpec(actualResource)); | |||
var diffJsonPatch = JsonDiff.asJson(desiredSpecNode, actualSpecNode); | |||
if (equality && diffJsonPatch.size() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still would like a comment here to explain why this makes a difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added comment
...vaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesResourceMatcher.java
Outdated
Show resolved
Hide resolved
...vaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesResourceMatcher.java
Outdated
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! |
No description provided.